

set more off
mat drop _all


clear all
* Import the file.
import excel "$path_data/data/Kumon_CBA_IRR_v11.xls", sheet("20%up_cost_witoutFC") cellrange(J47:BA49)


* The file format is wide, so transform it.


xpose, clear


rename v1 year
rename v2 IRR
rename v3 benefit

gen IRR_0 = 0
gen benefit_1 = 1


twoway (line IRR year, yaxis(1) lcolor(blue)) ///
(line IRR_0 year, yaxis(1) lcolor(blue) lpattern(shortdash)) ///
(line benefit year, yaxis(2) lcolor(red) lpattern(longdash)) ///
(line benefit_1 year, yaxis(2) lcolor(red) lpattern(dot)), ///
xlabel(,val) xtitle("Year") ytitle("Internal Rate of Returns", axis(1)) ytitle("Benefit-Cost Ratio", axis(2)) ///
 xline(11, lcolor(blue) lpattern(shortdash)) ///
  xline(16, lcolor(red) lpattern(dot)) ///
xlabel(1 5 10 15 20 25 30 35 40 45) ylabel(-1 -0.5 0, axis(1)) ylabel(0 0.5 1 1.5 2, axis(2)) ///
legend(order(1 "Internal Rate of Returns" 3 "Benefit-Cost Ratio") pos(5) ring(0) ///
col(1) rowgap(0.2)) graphregion(color(white)) plotregion(fcolor(white)) graphregion(margin(medlarge)) ///
ylabel(,angle(0))
*graph export "`graphpath'/cost_benefit_analysis_20percent.png", replace

graph export "$pardir/figureI2.pdf", replace as(pdf)


clear 

import excel "$path_data/data/Kumon_CBA_IRR_v11.xls", sheet("Used_only_without_FC") cellrange(L47:BC49)


* The file format is wide, so transform it.


xpose, clear


rename v1 year
rename v2 IRR
rename v3 benefit

gen IRR_0 = 0
gen benefit_1 = 1


twoway (line IRR year, yaxis(1) lcolor(blue)) ///
(line IRR_0 year, yaxis(1) lcolor(blue) lpattern(shortdash)) ///
(line benefit year, yaxis(2) lcolor(red) lpattern(longdash)) ///
(line benefit_1 year, yaxis(2) lcolor(red) lpattern(dot)), ///
xlabel(,val) xtitle("Year") ytitle("Internal Rate of Returns", axis(1)) ytitle("Benefit-Cost Ratio", axis(2)) ///
 xline(10, lcolor(blue) lpattern(shortdash)) ///
  xline(14, lcolor(red) lpattern(dot)) ///
xlabel(1 5 10 15 20 25 30 35 40 45) ylabel(-1 -0.5 0, axis(1)) ylabel(0 0.5 1 1.5 2, axis(2)) ///
legend(order(1 "Internal Rate of Returns" 3 "Benefit-Cost Ratio") pos(5) ring(0) ///
col(1) rowgap(0.2)) graphregion(color(white)) plotregion(fcolor(white)) graphregion(margin(medlarge)) ///
ylabel(,angle(0))
*graph export "`graphpath'/cost_benefit_analysis_only.png", replace

graph export "$pardir/figureI1.pdf", replace as(pdf)








